import {Text, TouchableOpacity} from 'M/UI/Libraries';
import React, {useEffect, useState} from 'react';
import {Theme} from '@react-navigation/native';
import Style from 'M/UI/Style';

const HomeHeaderRight: React.FC<any> = props => {
  const [theme, setTheme] = useState<Theme>(Style.theme);
  const onPress = () => {
    props.navigation.navigate('PhoneLogin');
  };
  useEffect(() => {
    Style.addThemeChangeListener(setTheme);
  }, []);

  return (
      <TouchableOpacity
          style={{
            paddingLeft: 5,
            paddingRight: 5,
            alignItems: 'center',
            justifyContent: 'center',
          }}
          onPress={onPress}>
        <Text style={[{fontSize: 18, color: theme.colors.text}]}>登陆</Text>
      </TouchableOpacity>
  );
}

export default HomeHeaderRight;
